Skip to content

Conversation

@taisho6339
Copy link

@taisho6339 taisho6339 commented Nov 29, 2025

Fixes #1125

Changes

Optimize InstrumentationScope handling by wrapping it in Arc instead of cloning for each span processor.

Previously, when a span ended, the InstrumentationScope (approximately 120 bytes) was cloned once for each SpanProcessor, causing unnecessary allocations and memory copies. This change wraps InstrumentationScope in Arc at tracer creation time, so subsequent clones are just atomic reference count increments.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@taisho6339 taisho6339 changed the title refactor: avoid instrumentation_scope clone for every single span pro… refactor: avoid instrumentation_scope clone for every single span processor Nov 29, 2025
@codecov
Copy link

codecov bot commented Nov 29, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.8%. Comparing base (df412fe) to head (e2ecd0c).

Files with missing lines Patch % Lines
opentelemetry-proto/src/transform/trace.rs 85.7% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3267   +/-   ##
=====================================
  Coverage   80.8%   80.8%           
=====================================
  Files        129     129           
  Lines      23203   23208    +5     
=====================================
+ Hits       18750   18755    +5     
  Misses      4453    4453           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@taisho6339 taisho6339 marked this pull request as ready for review November 29, 2025 03:21
@taisho6339 taisho6339 requested a review from a team as a code owner November 29, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance: send instrumentation library data to span processors once, not for every span when it ends

1 participant